<div class="blazorise-codeblock">
<div class="html"><pre>
[Theory, AutoNSubstituteData]
    public void RegistrationViewModel_ValidatesAndFiresRegisterCommand([Frozen]IAccountRepo repo, LoginModelValidator validator)
        =&gt; new TestScheduler().With(scheduler =&gt;
        {
            //Arrange
            repo.RegisterUser(Arg.Any<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">RegistrationModel</span><span class="htmlTagDelimiter">&gt;</span>()).Returns(true);
            var nav = new MockNavigationManager();
            
            //Act
            var viewModel = new RegistrationViewModel(repo, validator, nav)
            {
                EmailAddress = &quot;me<span class="atSign">&#64;</span>mine.com&quot;,
                Password = &quot;Password&quot;
            };

            viewModel.Register.Execute().Subscribe();
            scheduler.AdvanceBy(5);

            //Assert
            viewModel.CanRegister.Should().BeTrue();
            repo.Received().RegisterUser(viewModel.RegistrationModel);
            nav.WasNavigateInvoked.Should().BeTrue();
        });
</pre></div>
</div>
